package com.example.ai.inventory.repository;

import com.example.ai.inventory.entity.SalesOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

/**
 * 销售单数据访问接口
 */
@Repository
public interface SalesOrderRepository extends JpaRepository<SalesOrder, Long> {
    
    /**
     * 根据销售单号查询销售单
     */
    Optional<SalesOrder> findByOrderNo(String orderNo);
    
    /**
     * 根据创建时间范围查询销售单
     */
    List<SalesOrder> findByCreateTimeBetween(LocalDateTime startTime, LocalDateTime endTime);
}